﻿
namespace TIKSN.StringSearchingAlgorithms.Tests
{
    [Microsoft.VisualStudio.TestTools.UnitTesting.TestClass]
    public class LongestCommonSubsequenceTests
    {
        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare001()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "XMJYAUZ";
            string y = "MZJAWXU";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(4, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare002()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "ABCDGH";
            string y = "AEDFHR";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(3, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare003()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "AGGTAB";
            string y = "GXTXAYB";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(4, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare004()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "HUMAN";
            string y = "CHIMPANZEE";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(4, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare005()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "PYTHON";
            string y = "PONY";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(3, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare006()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "1234";
            string y = "1224533324";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(4, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare007()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "thisisatest";
            string y = "testing123testing";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(7, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare008()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "ABAZDC";
            string y = "BACBAD";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(4, comparer.Compare(x, y));
        }

        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod]
        public void Compare009()
        {
            var comparer = new StringSearchingAlgorithms.LongestCommonSubsequence();

            string x = "ABCBDAB";
            string y = "BDCABA";

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual<int>(4, comparer.Compare(x, y));
        }
    }
}
